/*工资条详情*/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:frametrim/activity/salaryFeedbackPage.dart';
import 'package:frametrim/app/app_navigator.dart';
import 'package:frametrim/appviews/salaryDetailHeaderView.dart';
import 'package:frametrim/appviews/salaryDetailsBankView.dart';
import 'package:frametrim/appviews/salaryDetailsProjectView.dart';
import 'package:frametrim/utility/screen.dart';
import 'package:frametrim/utility/sq_color.dart';
import 'package:frametrim/views/appbar_black.dart';
import 'package:frametrim/views/button_circle_single.dart';
import 'package:frametrim/views/button_round.dart';
import 'package:frametrim/views/button_round_single.dart';

class SalaryDetailsPage extends StatefulWidget {
  late String id;

  @override
  State<StatefulWidget> createState() => SalaryDetailsState();

  SalaryDetailsPage(this.id);
}

class SalaryDetailsState extends State<SalaryDetailsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: AnnotatedRegion(
        value: SystemUiOverlayStyle.light,
        child: Stack(
          children: <Widget>[
            Container(
              height: 260,
              width: Screen.width,
              color: Color(0xff3D8AFF),
            ),
            Container(
              width: Screen.width,
              height: Screen.height,
              child: Column(
                children: <Widget>[
                  AppbarCenterTitle(
                    title: '工资条',
                    imgStr: 'image/imv_back_white.png',
                    titleColor: SQColor.white,
                  ),
                  Expanded(
                      child: MediaQuery.removePadding(
                          context: context,
                          removeTop: true,
                          child: ListView(
                            children: <Widget>[
                              Container(
                                margin: EdgeInsets.only(top: 24),
                                padding: EdgeInsets.only(left: 10, right: 10),
                                child: Column(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: <Widget>[
                                    Text(
                                      '本月应发工资',
                                      style: TextStyle(
                                          color: Colors.white, fontSize: 20),
                                    ),
                                    SizedBox(
                                      height: 5,
                                    ),
                                    Text(
                                      '9658.32',
                                      style: TextStyle(
                                          color: Colors.white, fontSize: 44),
                                    ),
                                    SizedBox(
                                      height: 20,
                                    ),
                                    SalaryDetailsStatueView(),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.all(10),
                                padding: EdgeInsets.all(15),
                                decoration: ShapeDecoration(
                                    color: Colors.white,
                                    shape: RoundedRectangleBorder(
                                        borderRadius: BorderRadius.all(
                                            Radius.circular(5)))),
                                child: Column(
                                  children: <Widget>[
                                    SalaryDetailsProjectView(),
                                    SizedBox(
                                      height: 20,
                                    ),
                                    SalaryDetailsBankView(),
                                  ],
                                ),
                              ),
                              GestureDetector(
                                onTap: () {
                                  print('点击查看工资审核记录');
                                  AppNavigator.pushToSalaryRecords(context, '');
                                },
                                child: Container(
                                    height: 40,
                                    child: Center(
                                      child: Text(
                                        '查看工资审核记录',
                                        style: TextStyle(
                                            fontSize: 16,
                                            color: SQColor.color_237BFC),
                                      ),
                                    )),
                              ),
                            ],
                          ))),
                  buildButton()
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }

  /*底部按钮*/
  Widget buildButton() {
    return Container(
      width: Screen.width,
      height: 60,
      // margin: EdgeInsets.only(left: 52, right: 52),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            width: 130,
            height: 42,
            child: ButtonRoundSingleView(
                textStr:  '工资有疑问', textColor:SQColor.color_3C64F9,buttonColor: SQColor.color_3C64F9, onPress: () {
              AppNavigator.pushToSalaryFeedBack(context, '');
              // AppNavigator.pushWithName(context, SalaryFeedBackPage(''), 'SalarySure');
            }),
          ),
          SizedBox(
            width: 20,
          ),
          Container(
            width: 130,
            height: 42,
            child: ButtonRoundView(
              textStr: '确认无误',
              textColor: SQColor.white,
              onPress: () {},
              buttonColor: SQColor.color_3C64F9,
            ),
          ),
        ],
      ),
    );
  }
}
